//--------------------------------------------------------------------------
// 
//  Copyright (c) Chili Software.  All rights reserved. 
// 
//  File: MarkForDeletionEventArgs.cs
//
//  Description: EventArgs for ObjectContext event fired after mark for deletion.
// 
//--------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;

namespace Chili.Opf3
{
	/// <summary>
	/// EventArgs used in the <see cref="Opf3.ObjectContext">ObjectContext</see> event
	/// that is invoked after marking an object for deletion.
	/// </summary>
	/// <remarks>
	/// This class is used by the <see cref="Opf3.ObjectContext">ObjectContext</see> in
	/// the event that is invoked after the mark for deletion of an object to send additional event
	/// data. The data contains the object that is marked for deletion.
	/// </remarks>
	[Serializable]
	public sealed class MarkForDeletionEventArgs : EventArgs
	{
		private object _obj;
		
		/// <summary>
		/// Creates a new instance of the<see cref="MarkForDeletionEventArgs">MarkForDeletionEventArgs Class</see>.
		/// </summary>
		/// <param name="obj">The object that is affected by the current operation. This object is marked for deletion in the storage. </param>
		/// <exception cref="System.ArgumentNullException">Obj is null.</exception>
		internal MarkForDeletionEventArgs(object obj)
        {
            if (obj == null)
                throw new ArgumentNullException("obj");

            _obj = obj;
        }

		/// <summary>
		/// Returns the object that is affected by the current operation. This object is
		/// marked for deletion in the storage.
		/// </summary>
		/// <value>The object affected by the current operation.</value>
		public object Object
		{
			get { return _obj; }
		}
	}
}
